package com.server;

import java.sql.*;

import javax.servlet.http.HttpServlet;


public class CustomerServlet extends HttpServlet
{
	protected java.sql.Connection connection = null;
	private static final long serialVersionUID = 8526472295622776147L;
		
	public void ConnectDB()
	{
		String connectionString = "jdbc:mysql://localhost/PlaneSimple?user=sqluser&password=sqluserpw";

		try
        {
            // Ensure the SQL Server driver class is available.
            Class.forName("com.mysql.jdbc.Driver");

            // Establish the connection.
            connection = DriverManager.getConnection(connectionString);
        }
        // Exception handling
        catch (ClassNotFoundException cnfe)  
        {
        	
            System.out.println("ClassNotFoundException " +
                               cnfe.getMessage());
        }
        catch (Exception e)
        {
            System.out.println("Exception " + e.getMessage());
            e.printStackTrace();
        }
				
	}
	
	public boolean NaN(String s) 
	{
		try 
		{
			Double.parseDouble(s);
		}
		catch (NumberFormatException nfe) 
		{
			return true;
		}
		return false;
	}
}
